package com.cq.hd.common.enums.biz;

import lombok.Getter;

/**
 * @description: 签约人类型：1-法人，2-联系人，3-其他人
 * @author: mYunYu
 * @date: 2021/8/23 14:28
 * @version: v1.0
 */
public enum SignUserTypeEnum {

    LEGAL(1, "LEGAL"),
    CONTACT(2, "CONTACT"),
    OTHER(3, "OTHER"),
    ;

    @Getter
    private final Integer value;

    @Getter
    private final String name;

    SignUserTypeEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    public static SignUserTypeEnum typeOfValue(Integer value) {
        SignUserTypeEnum[] values = SignUserTypeEnum.values();
        for (SignUserTypeEnum v : values) {
            if (v.value.equals(value)) {
                return v;
            }
        }
        return null;
    }

    public static SignUserTypeEnum typeOfName(String name) {
        SignUserTypeEnum[] values = SignUserTypeEnum.values();
        for (SignUserTypeEnum v : values) {
            if (v.name.equals(name)) {
                return v;
            }
        }
        return null;
    }

}
